Last updated: 2019-07-04
Checks: 5 1
Knit directory: diffNet/
This reproducible R Markdown analysis was created with workflowr (version 1.2.0). The Report tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20190331) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: R/.DS_Store
Ignored: R/.Rhistory
Ignored: analysis/.DS_Store
Ignored: analysis/.Rhistory
Ignored: docs/.DS_Store
Ignored: docs/figure/.DS_Store
Ignored: src/.DS_Store
Untracked files:
Untracked: .Rprofile
Untracked: .gitignore
Untracked: analysis/TFs.Rmd
Untracked: analysis/TFs.pdf
Untracked: analysis/Unscaled.Rmd
Untracked: analysis/figure/
Untracked: analysis/simulation5.Rmd
Untracked: analysis/unscale.R
Untracked: data/
Untracked: docs/figure/liquid_assoc.Rmd/
Untracked: docs/figure/simulation1.Rmd/
Untracked: docs/figure/simulation2.Rmd/
Untracked: docs/figure/simulation3.Rmd/
Untracked: docs/figure/simulation4.Rmd/
Untracked: man/do_polyroot_arma.Rd
Untracked: man/do_polyroot_cpp.Rd
Untracked: man/post_score.Rd
Untracked: old_analysis/
Untracked: targeted_TF_AA.txt
Untracked: wandv.R
Unstaged changes:
Modified: .Rbuildignore
Modified: DESCRIPTION
Modified: NAMESPACE
Modified: analysis/AA.Rmd
Modified: analysis/AA_EA.Rmd
Deleted: analysis/AA_vs_EA_skin_not_sun_exposed.Rmd
Deleted: analysis/AA_vs_EA_skin_not_sun_exposed.pdf
Modified: analysis/W_and_V.Rmd
Modified: analysis/W_and_V_alt.Rmd
Modified: analysis/_site.yml
Modified: analysis/about.Rmd
Modified: analysis/correction.Rmd
Modified: analysis/correction.pdf
Deleted: analysis/index.Rmd
Deleted: analysis/license.Rmd
Deleted: analysis/score_test.R
Modified: docs/.nojekyll
Modified: dynamic_coexpression_githubversion.tex
Deleted: src/diffNet.so
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view them.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 647013d | tk382 | 2019-07-04 | update R files and analysis files |
| Rmd | f458a7a | tk382 | 2019-06-29 | add simulation files |
n = 30
X = scale(rnorm(n)) * sqrt(n) / sqrt(n-1)
X = cbind(rep(1, n), X)
B = 1000power = c("LM", "LA", "Fisher")
for (a in c(0, 0.5, 1, 1.5, 2)){
if(a==0){
rho = runif(1,-1,1)
}
else{
alpha = c(0, a)
rho = h1_fisher(X, alpha)
}
out = do_sim(X = X, n = n, B = B, rho = rho, mles = TRUE)
# save(out, file = paste0("simulation_n30_fisher_", a, ".RData"))
power = cbind(power, powercheck(out, B = B, n = a)[,2])
}
print(power) power
[1,] "LM" "0.052" "0.206" "0.542" "0.795" "0.91"
[2,] "LA" "0.054" "0.18" "0.511" "0.722" "0.828"
[3,] "Fisher" "0.046" "0.247" "0.693" "0.965" "0.992"
newX = cbind(rep(1, 1000), sort(runif(1000, -2.5, 2.5)))
df = data.frame(alpha1 = h1_fisher(newX, c(0,0.5)),
alpha2 = h1_fisher(newX, c(0,1)),
alpha3 = h1_fisher(newX, c(0,1.5)),
alpha4 = h1_fisher(newX, c(0,2)))
df = melt(df)No id variables; using all as measure variables
df$X = rep(newX[,2], 4)
levels(df$variable) = c("0.5", "1", "1.5", "2")
colnames(df)[1] = "alpha"
ggplot(df, aes(x = X, y = value, col = alpha)) + geom_line() + labs(color=expression(alpha)) +
ylab(expression(rho)) +
xlab(expression(X)) +
theme_bw(base_size=12)+
ggtitle("tanh")ggsave("fisher.png", height = 3, width = 3)power = c("LM", "LA", "Fisher")
for (a in c(0.2, 0.3, 0.4, 0.5)){
if(a==0){
rho = runif(1,-1,1)
}
else{
alpha = c(0, a)
rho = h6_quadratic(X, alpha)
rho = pmin(0.99, rho); rho = pmax(-0.99, rho)
}
out = do_sim(X = X, n = n, B = B, rho = rho, mles = TRUE)
# save(out, file = paste0("simulation_n30_sin_", a, ".RData"))
power = cbind(power, powercheck(out, B = B, n = a)[,2])
}
print(power) power
[1,] "LM" "0.627" "0.587" "0.539" "0.531"
[2,] "LA" "0.042" "0.047" "0.058" "0.079"
[3,] "Fisher" "0.533" "0.438" "0.371" "0.338"
newX = cbind(rep(1, 1000), sort(runif(1000, -2.5, 2.5)))
df = data.frame(alpha1 = h6_quadratic(newX, c(0,0.2)),
alpha2 = h6_quadratic(newX, c(0,0.3)),
alpha3 = h6_quadratic(newX, c(0,0.4)),
alpha4 = h6_quadratic(newX, c(0,0.5)))
df = melt(df)No id variables; using all as measure variables
df$X = rep(newX[,2], 4)
levels(df$variable) = c("0.2", "0.3", "0.4", "0.5")
colnames(df)[1] = "alpha"
ggplot(df, aes(x = X, y = value, col = alpha)) + geom_line() +labs(color=expression(alpha)) +
ylab(expression(rho)) +
xlab(expression(X)) +
theme_bw(base_size=12)+
ggtitle("quadratic")ggsave("quadratic.png", width=3, height=3)t_la = out$t_la
t_fisher = out$t_fisher
t_lm = out$t_lm
df = data.frame(score = log10(t_lm),
LR = log10(t_fisher),
LA = log10(t_la))
ggplot(melt(df), aes(x=variable, y=value)) +
geom_violin() +
ylab(expression(log[10]~time)) +
xlab("") +
ylim(c(-5, -1)) +
ggtitle("computation time")No id variables; using all as measure variables
sessionInfo()R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_3.1.0 reshape2_1.4.3 diversitree_0.9-11
[4] ape_5.3
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 compiler_3.5.3
[3] pillar_1.3.1 git2r_0.25.2
[5] plyr_1.8.4 workflowr_1.2.0
[7] tools_3.5.3 digest_0.6.18
[9] evaluate_0.13 tibble_2.1.1
[11] nlme_3.1-137 gtable_0.3.0
[13] lattice_0.20-38 pkgconfig_2.0.2
[15] rlang_0.3.3 yaml_2.2.0
[17] parallel_3.5.3 xfun_0.5
[19] RcppArmadillo_0.8.600.0.0 withr_2.1.2
[21] stringr_1.4.0 dplyr_0.8.0.1
[23] knitr_1.22 fs_1.2.7
[25] tidyselect_0.2.5 rprojroot_1.3-2
[27] grid_3.5.3 deSolve_1.23
[29] glue_1.3.1 R6_2.4.0
[31] rmarkdown_1.12 purrr_0.3.2
[33] magrittr_1.5 whisker_0.3-2
[35] backports_1.1.3 scales_1.0.0
[37] codetools_0.2-16 htmltools_0.3.6
[39] assertthat_0.2.1 colorspace_1.4-1
[41] labeling_0.3 subplex_1.5-4
[43] stringi_1.4.3 lazyeval_0.2.2
[45] munsell_0.5.0 crayon_1.3.4